/**
 * 详情对话框
 */
var FileInfoDlg = {
    data: {
        fileType: "",
        fileName: "",
        latestFileVersion: ""
    }
};

layui.use(['form', 'admin', 'ax', 'upload'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;
    var upload = layui.upload;

    //让当前iframe弹层高度适应
    admin.iframeAuto();

    //获取详情信息，填充表单
    var ajax = new $ax(Feng.ctxPath + "/file/detail?id=" + Feng.getUrlParam("id"));
    var result = ajax.start();
    form.val('fileForm', result.data);

    upload.render({
        elem: '#rsz'
        , url: Feng.ctxPath + "/file/updateFileItem"
        , auto: false //选择文件后不自动上传
        , bindAction: '#btnSubmit'
        , data: {
            fileId: function () {
                return $("#id").val()
            }
        }
        , before: function (obj) {
            console.log(obj);
        }
        , done: function (res) {
            //   console.log(res)
        }
    });

});